﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataAccesLayer.DomainModel
{
    /// <summary>
    /// this is the base class all daos extend 
    /// </summary>
    public  class BaseDataAccesObject :System .ComponentModel .IEditableObject 
    {
        public event EventHandler OnEndEdit;

        #region IEditableObject Members

        public void BeginEdit()
        {

        }

        public void CancelEdit()
        {

        }

        public void EndEdit()
        {
            if(OnEndEdit !=null )
            OnEndEdit(this, new EventArgs());
        }

        #endregion

        protected string GetLocalizedString(string name)
        {
            RootLibrary.WPF.Localization.LocalizeDictionary dictionary = RootLibrary.WPF.Localization.LocalizeDictionary.Instance;

            dictionary.resourceAssembly = "EQualApplication";
            dictionary.resourceDictionary = "ResTexts";

            string localized =  dictionary.GetLocizedObject<string>(name) as string   ;
            return localized;
        }
    }
}
